/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 言初
 * Date: 2023-12-25
 * Time: 22:13
 */
import java.util.Scanner;

//归并排序
public class Main4 {
    public static long[] tmp=new long[0];
    public static void func(long[] arr,long left,long right){
        if(right<=left){
            return;
        }

        long mid=(left+right)/2;
        func(arr,left,mid);
        func(arr,mid+1,right);
        //归并2个有序数组
        long a=left;
        long b=mid+1;

        long p=0;
        while(a<=mid && b<=right){
            if(arr[(int)a]<arr[(int)b]){
                tmp[(int)p]=arr[(int)a];
                a++;
                p++;
            }else{
                tmp[(int)p]=arr[(int)b];
                b++;
                p++;
            }
        }

        while(a<=mid){
            tmp[(int)p]=arr[(int)a];
            a++;
            p++;
        }

        while(b<=right){
            tmp[(int)p]=arr[(int)b];
            b++;
            p++;
        }
        long pp=0;
        for(long i=left;i<=right;i++){
            arr[(int)i]=tmp[(int)pp];
            pp++;
        }
    }

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long n=sc.nextLong();
        long[] arr=new long[(int)n];
        tmp=new long[(int)n];
        for(long i=0;i<n;i++){
            arr[(int)i]=sc.nextLong();
        }

        func(arr,0,n-1);
        for(long i=0;i<n;i++){
            if(i<n-1){
                System.out.print(arr[(int)i]+" ");
            }else{
                System.out.print(arr[(int)i]);
            }
        }
        //System.out.println();
    }


}











/*

//堆排序
import java.util.*;


public class Main {

    //堆排序
    //向下调整
    public static void down(long[] arr ,int  begin,int end){
        if(begin>=end){
            return;
        }
        int parent=begin;
        int child=parent*2+1;
        while(child<=end){
            if(child+1<=end && arr[child]<arr[child+1]){
                child+=1;
            }

            if(arr[parent]<arr[child]){
                long ret=arr[parent];
                arr[parent]=arr[child];
                arr[child]=ret;
            }

            parent=child;

            child=parent*2+1;
        }

    }

    //public static long[] tmp=new long[0];
    //堆排序
    public static void func(long[] arr,int left,int right){
        //调整成堆
        for(int i=right;i>=left;i--){
            down(arr,i,right);
        }

        while(left<right){
            long ret=arr[left];
            arr[left]=arr[right];
            arr[right]=ret;

            down(arr,left,right-1);

            right--;
        }

    }




    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        long[] arr=new long[(int)n];
        //tmp=new long[(int)n];
        for(long i=0;i<n;i++){
            arr[(int)i]=sc.nextLong();
        }

        func(arr,0,n-1);
        for(long i=0;i<n;i++){
            if(i<n-1){
                System.out.print(arr[(int)i]+" ");
            }else{
                System.out.print(arr[(int)i]);
            }
        }
        //System.out.println();
    }



}

*/

